<?php
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use kartik\datetime\DateTimePicker;
?>
<!-- main container -->
<div class="content">

    <div class="container-fluid">
        <div id="pad-wrapper" class="new-user">
            <div class="row-fluid header">
                <h3><?=$model->id?'编辑':'添加'?>分类</h3>
            </div>

            <div class=" form-wrapper">
                <!-- left column -->
                <div class="span9 with-sidebar">
                    <div class="container">
                        <?php $form=ActiveForm::begin([
                            'fieldConfig'=>[
                                'template'=>'{error}{input}'
                            ]
                        ]); ?>
                        <?php
                        if(Yii::$app->session->hasFlash('info')){
                            echo Yii::$app->session->getFlash('info');
                        }
                        ?>
                        <div class="span12 field-box">
                            <label>分类名称:</label>
                            <?=$form->field($model,'name')->textInput(['class'=>'span9'])?>
                        </div>
                        <div class="span12 field-box">
                            <label>父级:</label>
                                <?=$form->field($model,'parent_id')->textInput(['class'=>'span9'])?>
                        </div>
                        <div class="span12 field-box">
                            <label>是否为目录:</label>
                            <?=$form->field($model,'is_dir')->radioList([
                                1 => '是',
                                2 => '否'
                            ]);?>
                        </div>

                        <div class="span11 field-box actions">
                            <?= Html::submitButton('保存',['class'=>"btn-glow primary"])?>
                            <span>OR</span>
                            <input type="reset" value="取消" class="reset" />
                        </div>
                        <?=$model->id?$form->field($model,'id')->hiddenInput():''?>

                        <?php ActiveForm::end();?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end main container -->